package com.itheima.health.controller;

import com.itheima.health.common.MessageConst;
import com.itheima.health.dao.CheckGroupDao;
import com.itheima.health.entity.Result;
import com.itheima.health.pojo.CheckGroup;
import com.itheima.health.pojo.Setmeal;
import com.itheima.health.service.CheckGroupService;
import com.itheima.health.service.MobileSetMealService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * C端
 */
@RestController
@RequestMapping("/mobile/setmeal")
@Slf4j
public class MobileSetMealController {

    @Autowired
    private MobileSetMealService mobileSetMealService;

    @Autowired
    private CheckGroupService checkGroupService;

        /**
     * C端_体检预约_套餐详情查看
     */
    @GetMapping("/findById")
    public Result findById(Integer id){
        log.info("前:{},{}",id);
        Setmeal setmeal=mobileSetMealService.findById(id);
        return new Result(true, MessageConst.QUERY_ORDER_SUCCESS,setmeal);
    }

    @GetMapping("/getSetmeal")
    public Result getSetmeal(){
        List<Setmeal> setmealList = mobileSetMealService.findAll();
        return new Result(true,MessageConst.QUERY_SETMEALLIST_SUCCESS,setmealList);
    }


}
